home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / dialupip / dialupip2.0 / src / dulib / progname.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-11  |  1.2 KB  |  32 lines

  1. /*
  2. **  Store and set the global variable that contains the program's name.
  3. **  Copyright (c) 1991 Bolt Beranek and Newman, Inc.
  4. **  All rights reserved.
  5. **
  6. **  Redistribution and use in source and binary forms are permitted
  7. **  provided that: (1) source distributions retain this entire copyright
  8. **  notice and comment, and (2) distributions including binaries display
  9. **  the following acknowledgement:  ``This product includes software
  10. **  developed by Bolt Beranek and Newman, Inc. and CREN/CSNET'' in the
  11. **  documentation or other materials provided with the distribution and in
  12. **  all advertising materials mentioning features or use of this software.
  13. **  Neither the name of Bolt Beranek and Newman nor CREN/CSNET may be used
  14. **  to endorse or promote products derived from this software without
  15. **  specific prior written permission.
  16. **
  17. **  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  18. **  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  19. **  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  20. */
  21. #include <stdio.h>
  22. char    *progname = "<program>";
  23.  
  24. setprogname(name)
  25.     char    *name;
  26. {
  27.     extern char    *strrchr();
  28.     char    *p;
  29.  
  30.     progname = (p = strrchr(name, '/')) == NULL ? name : p + 1;
  31. }
  32.